From 8adc4e5ce7382811854d39771ce6f06a8c2291c2 Mon Sep 17 00:00:00 2001 From: "Ian.Campbell@xensource.com" Date: Fri, 21 Apr 2006 17:19:26 +0100 Subject: [PATCH] Remove CONFIG_X86_SYSENTER option. Signed-off-by: Ian Campbell --- linux-2.6-xen-sparse/arch/i386/Kconfig | 5 ----- linux-2.6-xen-sparse/arch/i386/kernel/Makefile | 11 ++++------- linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c | 5 ++++- linux-2.6-xen-sparse/arch/i386/kernel/entry-xen.S | 10 ++++------ linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c | 4 +--- linux-2.6-xen-sparse/arch/i386/kernel/vsyscall.S | 2 -- .../include/asm-i386/mach-xen/asm/processor.h | 2 -- 7 files changed, 13 insertions(+), 26 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/i386/Kconfig b/linux-2.6-xen-sparse/arch/i386/Kconfig index 9687edf9f0..661d0bbecd 100644 --- a/linux-2.6-xen-sparse/arch/i386/Kconfig +++ b/linux-2.6-xen-sparse/arch/i386/Kconfig @@ -1180,11 +1180,6 @@ config X86_NO_TSS depends on X86_XEN default y -config X86_SYSENTER - bool - depends on !X86_NO_TSS - default y - config X86_NO_IDT bool depends on X86_XEN diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/Makefile b/linux-2.6-xen-sparse/arch/i386/kernel/Makefile index 5661a9bb68..d0ccf7b375 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/Makefile +++ b/linux-2.6-xen-sparse/arch/i386/kernel/Makefile @@ -49,14 +49,12 @@ else vsyscall_note := vsyscall-note.o endif -VSYSCALL_TYPES-y := int80 -VSYSCALL_TYPES-$(CONFIG_X86_SYSENTER) += sysenter # vsyscall.o contains the vsyscall DSO images as __initdata. # We must build both images before we can assemble it. # Note: kbuild does not track this dependency due to usage of .incbin -$(obj)/vsyscall.o: $(foreach F,$(VSYSCALL_TYPES-y),$(obj)/vsyscall-$F.so) -targets += $(foreach F,$(VSYSCALL_TYPES-y),vsyscall-$F.o vsyscall-$F.so) -targets += $(vsyscall_note) vsyscall.lds +$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so +targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) +targets += vsyscall-note.o vsyscall.lds # The DSO images are built using a special linker script. quiet_cmd_syscall = SYSCALL $@ @@ -83,8 +81,7 @@ $(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o SYSCFLAGS_vsyscall-syms.o = -r $(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \ - $(foreach F,$(VSYSCALL_TYPES-y),$(obj)/vsyscall-$F.o) \ - $(obj)/$(vsyscall_note) FORCE + $(obj)/vsyscall-sysenter.o $(obj)/$(vsyscall_note) FORCE $(call if_changed,syscall) ifdef CONFIG_XEN diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c b/linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c index 3c4a0f46eb..c7e3c078a2 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/asm-offsets.c @@ -64,10 +64,13 @@ void foo(void) OFFSET(pbe_orig_address, pbe, orig_address); OFFSET(pbe_next, pbe, next); -#ifdef CONFIG_X86_SYSENTER +#ifndef CONFIG_X86_NO_TSS /* Offset from the sysenter stack to tss.esp0 */ DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) - sizeof(struct tss_struct)); +#else + /* sysenter stack points directly to esp0 */ + DEFINE(TSS_sysenter_esp0, 0); #endif DEFINE(PAGE_SIZE_asm, PAGE_SIZE); diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/entry-xen.S b/linux-2.6-xen-sparse/arch/i386/kernel/entry-xen.S index 072172cda7..78ad19ef2b 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/entry-xen.S +++ b/linux-2.6-xen-sparse/arch/i386/kernel/entry-xen.S @@ -202,7 +202,6 @@ need_resched: jmp need_resched #endif -#ifdef CONFIG_X86_SYSENTER /* SYSENTER_RETURN points to after the "sysenter" instruction in the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ @@ -250,7 +249,6 @@ sysenter_past_esp: xorl %ebp,%ebp sti sysexit -#endif /* CONFIG_X86_SYSENTER */ # system call handler stub @@ -683,7 +681,7 @@ device_available_emulate: call math_state_restore jmp ret_from_exception -#ifdef CONFIG_X86_SYSENTER +#ifndef CONFIG_XEN /* * Debug traps and NMI can happen at the one SYSENTER instruction * that sets up the real kernel stack. Check here, since we can't @@ -705,15 +703,15 @@ label: \ pushfl; \ pushl $__KERNEL_CS; \ pushl $sysenter_past_esp -#endif /* CONFIG_X86_SYSENTER */ +#endif /* CONFIG_XEN */ KPROBE_ENTRY(debug) -#ifdef CONFIG_X86_SYSENTER +#ifndef CONFIG_XEN cmpl $sysenter_entry,(%esp) jne debug_stack_correct FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) debug_stack_correct: -#endif /* !CONFIG_X86_SYSENTER */ +#endif /* !CONFIG_XEN */ pushl $-1 # mark this as an int SAVE_ALL xorl %edx,%edx # error code 0 diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c b/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c index 99193bb47f..32e44f0f01 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c @@ -24,7 +24,7 @@ extern asmlinkage void sysenter_entry(void); void enable_sep_cpu(void) { -#ifdef CONFIG_X86_SYSENTER +#ifndef CONFIG_X86_NO_TSS int cpu = get_cpu(); struct tss_struct *tss = &per_cpu(init_tss, cpu); @@ -54,14 +54,12 @@ int __init sysenter_setup(void) { syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); -#ifdef CONFIG_X86_SYSENTER if (boot_cpu_has(X86_FEATURE_SEP)) { memcpy(syscall_page, &vsyscall_sysenter_start, &vsyscall_sysenter_end - &vsyscall_sysenter_start); return 0; } -#endif memcpy(syscall_page, &vsyscall_int80_start, diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/vsyscall.S b/linux-2.6-xen-sparse/arch/i386/kernel/vsyscall.S index 432aa46649..b403890fe3 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/vsyscall.S +++ b/linux-2.6-xen-sparse/arch/i386/kernel/vsyscall.S @@ -7,11 +7,9 @@ vsyscall_int80_start: .incbin "arch/i386/kernel/vsyscall-int80.so" vsyscall_int80_end: -#ifdef CONFIG_X86_SYSENTER .globl vsyscall_sysenter_start, vsyscall_sysenter_end vsyscall_sysenter_start: .incbin "arch/i386/kernel/vsyscall-sysenter.so" vsyscall_sysenter_end: -#endif __FINIT diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h index 5b8d8be639..6c02802144 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h @@ -497,13 +497,11 @@ struct thread_struct { static inline void __load_esp0(struct tss_struct *tss, struct thread_struct *thread) { tss->esp0 = thread->esp0; -#ifdef CONFIG_X86_SYSENTER /* This can only happen when SEP is enabled, no need to test "SEP"arately */ if (unlikely(tss->ss1 != thread->sysenter_cs)) { tss->ss1 = thread->sysenter_cs; wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); } -#endif } #define load_esp0(tss, thread) \ __load_esp0(tss, thread) -- 2.30.2